﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Geometry
{
    class Program
    {
        public static void Main()
        {
            //var p0 = new Point2D();
            Point p1 = new Point2D(); // object p = new Point2D();
            IPoint p2 = new Point2D();

            Console.WriteLine(p1.GetType());
            Console.WriteLine(p2.GetType());
            Point2D poi = new Point2D();
            poi.Color = new Color { R = 0, G = 1, B = 2 };
            Console.WriteLine(poi.Color.ToString());

            PrintDistance(new Point { X = 5 });
            PrintDistance(new Point2D { X = 1, Y = 5 });
            PrintDistance(new RPoint2D { R = 7, Theta = Math.PI/6});

            PrintDistanceP(new Point { X = 5 });
            PrintDistanceP(new Point2D { X = 1, Y = 5 });
            //PrintDistanceP(new RPoint2D { R = 7, Theta = Math.PI / 6 });

            Print(new Point { X = 5 });
        }

        public static void PrintDistanceP(Point p)
        {
            Console.WriteLine(p.Distance);
        }
        public static void PrintDistance(IPoint p)
        {
            Console.WriteLine(p.Distance);
        }

        public static void Print(object obj)
        {
            Console.WriteLine(obj.ToString());
        }
    }
}
